#include "SceneFrame.h"


SceneFrame::SceneFrame(void)
	:_sceneLayer(nullptr)
{
	initFrame();
}


SceneFrame::~SceneFrame(void)
{
	EventMgr::inst()->removeEventListener("add_object_in_scene", this, &SceneFrame::onAddObjectToScene);
}

void SceneFrame::initFrame()
{
	_sceneLayer = SceneView::create();

	//Texture2D* tu = TextureCache::getInstance()->addImage("map/1001/img.jpg");
	//_sceneLayer->setBackground(tu);

	_sceneLayer->initMap(1001);

	EventMgr::inst()->addEventListener("add_object_in_scene", this, &SceneFrame::onAddObjectToScene);
}


void SceneFrame::show( void* data )
{

}

void SceneFrame::close()
{

}

void SceneFrame::onAddObjectToScene( void* event )
{

}


void SceneFrame::addObjectToScene( unsigned long id, Node* obj )
{

}

Node* SceneFrame::findObject()
{
	return nullptr;
}

void SceneFrame::resetMap()
{
	_sceneLayer->removeAllObject();
}
